package com.whfc.ms.api.emp.controller;

import com.whfc.common.base.BaseController;
import com.whfc.common.result.PageData;
import com.whfc.common.result.Result;
import com.whfc.common.result.ResultUtil;
import com.whfc.common.util.SessionAttr;
import com.whfc.emp.dto.AppTrainingCategoryDTO;
import com.whfc.emp.dto.AppTrainingUserProgressDTO;
import com.whfc.emp.param.AppTrainingCategoryAddParam;
import com.whfc.emp.param.AppTrainingCategoryEditParam;
import com.whfc.emp.param.AppTrainingCategoryListParam;
import com.whfc.emp.param.AppTrainingUserProgressListParam;
import com.whfc.fuum.entity.SysUser;
import com.whfc.ms.api.emp.service.MsTrainingCategoryService;
import com.whfc.ms.api.emp.service.MsTrainingUserProgressService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * 答题记录
 *
 * @author realm
 * @Description:
 */
@RestController
@RequestMapping("/ms/api/trainingStudyProgress")
public class AppTrainingUserStudyProgressController extends BaseController {
    @Autowired
    private MsTrainingUserProgressService msTrainingUserProgressService;

    /**
     * 答题记录-列表
     *
     * @param user
     * @param request
     * @return
     */
    @GetMapping("/list")
    public Result list(@SessionAttribute(SessionAttr.MS_USER) SysUser user, @Validated AppTrainingUserProgressListParam request) {
        request.setUserId(user.getId());//登录人的id
        PageData<AppTrainingUserProgressDTO> pageData = msTrainingUserProgressService.list(request);
        return ResultUtil.success(pageData);
    }

}
